Skip to content

ci(async-audit): enable Phase 2 — soft-fail visibility for async-route audit#94

Merged
pcalnon merged 2 commits intomainfrom
ci/async-route-audit-phase-2-enable
May 6, 2026
Merged

ci(async-audit): enable Phase 2 — soft-fail visibility for async-route audit#94
pcalnon merged 2 commits intomainfrom
ci/async-route-audit-phase-2-enable

Conversation

@pcalnon
Copy link
Copy Markdown
Owner

@pcalnon pcalnon commented May 6, 2026

Summary

Phase 2 enable for juniper-data. First of four Phase 2 PRs
(data → cascor → canopy → worker).

Flips the Phase 1 manual-stage hook to fire on regular commits and
adds a CI lane scoped to the same ASYNC ruleset, both soft-fail:

  • Pre-commit: `--exit-zero` (warnings, not failures)
  • CI: `continue-on-error: true` (PR annotations, not blocks)

What changes

```yaml

.pre-commit-config.yaml

  • id: ruff
    alias: ruff-async-audit
    ...
    stages: [pre-commit, manual] # was: [manual]
    ```

```yaml

.github/workflows/ci.yml — new job

async-route-audit:
name: Async-route audit (BUG-JD-10 class, soft-fail)
runs-on: ubuntu-latest
continue-on-error: true
steps:
... ruff install + run ...
```

Effect

The 3 `ASYNC240` violations Phase 0 enumerated
(`juniper_data/api/app.py:46` and `api/routes/health.py:131, 132`)
will surface as PR annotations and pre-commit warnings starting
with the next PR that touches those files. Phase 3 cleanup is
~30 minutes of work to wrap them in `await asyncio.to_thread(...)`.

Phase 4 will drop both `--exit-zero` and `continue-on-error` so
future violations block.

Test plan

  • `pre-commit run ruff-async-audit` (without `--hook-stage manual`)
    runs and passes — hook now fires on regular commits.
  • No formatting / no other behaviour changed.

🤖 Generated with Claude Code

…e audit

Flips the Phase 1 manual-stage hook to fire on regular commits and
adds a CI lane scoped to the same ASYNC ruleset, both as soft-fail
(``--exit-zero`` for the hook, ``continue-on-error: true`` for CI).

Effect: violations surface as PR annotations and pre-commit
warnings without blocking merge or commits. The 3 ASYNC240
violations Phase 0 enumerated (juniper_data/api/app.py:46 and
api/routes/health.py:131,132) become visible to anyone touching
those files; Phase 3 cleans them up.

Phase 4 will drop ``--exit-zero`` (pre-commit) and
``continue-on-error: true`` (CI) so future violations block.

First of four Phase 2 enable PRs (data → cascor → canopy →
worker). Per the migration plan
(juniper-ml notes/ASYNC_ROUTE_AUDIT_HOOK_MIGRATION_PLAN.md §4).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@pcalnon pcalnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

Without ``--exit-zero``, ruff exits 1 when it finds violations,
which makes the CI step (and therefore the ``async-route-audit``
job) show as red — even with ``continue-on-error: true`` on the
job. The job-level flag prevents the workflow from failing as a
whole, but the visual indicator on the PR is still red.

Phase 2's intent is "violations surface as annotations, no merge
block, no red indicator". ``--exit-zero`` makes the step exit 0
while ``--output-format=github`` still renders the violations as
annotations. Belt and suspenders alongside ``continue-on-error``.

Phase 4 will drop both ``--exit-zero`` and ``continue-on-error``.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@pcalnon pcalnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

@pcalnon pcalnon merged commit 21b8d8e into main May 6, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant